Skip to content

Conversation

@sdat2
Copy link

@sdat2 sdat2 commented Aug 17, 2020

Here is a PR just adding a method called add_pca_to_xarray to the pcm class. The name and implementation could be improved, so please feel free to change whatever you would like to.

@gmaze gmaze self-requested a review August 17, 2020 12:42
@gmaze gmaze marked this pull request as ready for review August 17, 2020 12:42
Copy link
Member

@gmaze gmaze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdat2 , thanks for your contribution !

this new function seems to return an unravelled version of the preprocessed data, which in this specific PCM configuration, happens to be the stacked/joined PCA eigen values.

so, my comments:

  1. if users modified default options, the returned array may not corresponds to the PCA value (eg: if using another reduce function), so the vocab here would be wrong.
  2. the pca dimension of the output array could be generalized as a "reduced_dimension", which is a reduced version of the dim passed as argument.
  3. I would rather return by default a dataset where the feature variables are back into separate dataArrays, instead of the stacked version here. At least this should be an option (and possibly takes into account the tentative future PCM option "join" discussed in #27 )

The request changes are thus a more general version of this function taking into account the 3 comments above.
Then the documentation could be updated to show users how to get access to PCA values using this new function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants